home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
update1a
/
frmlogin.frm
(
.txt
)
< prev
next >
Wrap
Visual Basic Form
|
1999-07-26
|
3KB
|
109 lines
VERSION 5.00
Begin VB.Form frmLogin
BorderStyle = 3 'Fixed Dialog
Caption = "Login to Web Browser"
ClientHeight = 1572
ClientLeft = 48
ClientTop = 336
ClientWidth = 3888
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1572
ScaleWidth = 3888
ShowInTaskbar = 0 'False
StartUpPosition = 2 'CenterScreen
Tag = "Login"
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "Cancel"
Height = 360
Left = 2040
TabIndex = 5
Tag = "Cancel"
Top = 1080
Width = 1140
End
Begin VB.CommandButton cmdOK
Caption = "Login"
Default = -1 'True
Height = 360
Left = 840
TabIndex = 4
Tag = "OK"
Top = 1080
Width = 1140
End
Begin VB.TextBox txtPassword
Height = 285
IMEMode = 3 'DISABLE
Left = 1320
PasswordChar = "*"
TabIndex = 1
Top = 600
Width = 2325
End
Begin VB.TextBox txtUserName
Height = 285
Left = 1305
TabIndex = 3
Top = 120
Width = 2325
End
Begin VB.Label lblLabels
Caption = "&Password:"
Height = 252
Index = 1
Left = 240
TabIndex = 0
Tag = "&Password:"
Top = 600
Width = 1080
End
Begin VB.Label lblLabels
Caption = "&User Name:"
Height = 252
Index = 0
Left = 240
TabIndex = 2
Tag = "&User Name:"
Top = 120
Width = 1080
End
Attribute VB_Name = "frmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpbuffer As String, nSize As Long) As Long
Public OK As Boolean
Private Sub Form_Load()
Dim sBuffer As String
Dim lSize As Long
sBuffer = Space$(255)
lSize = Len(sBuffer)
Call GetUserName(sBuffer, lSize)
If lSize > 0 Then
txtUserName.Text = Left$(sBuffer, lSize)
Else
txtUserName.Text = vbNullString
End If
End Sub
Private Sub cmdCancel_Click()
OK = False
Me.Hide
End Sub
Private Sub cmdOK_Click()
'To Do - create test for correct password
'check for correct password
If txtPassword.Text = "guest" Then
OK = True
Me.Hide
Else
MsgBox "Invalid Password, try again!", , "Login"
txtPassword.SetFocus
txtPassword.SelStart = 0
txtPassword.SelLength = Len(txtPassword.Text)
End If
End Sub